using IQIGame.Onigao.GamePlay;
using System.Collections.Generic;

namespace IQIGame.Onigao.Logic
{
    /// <summary>
    /// 播放动画执行
    /// 参数1:1：tag（0代表自己），2：动画表id
    /// </summary>
    public class ExecPlayEntityAnimation : BaseServiceExecution
    {
        public override void Execute(LevelRegion region, LevelPlayer player)
        {
            var config = _config as ExecParamPlayEntityAnimation;
            //List不用对象池了，这里通知可能会因AOI延迟，不能立刻放入对象池，代码会写得很难看
            List<LevelEntity> entities = new List<LevelEntity>();
            if (!LgLevelEntityUtil.GetEntitiesByDynCfgKeys(region, triggerEntity, config.tagOrMcid, entities))
            {
                return;
            }
            region.NotifyPlayEntityAnimAction(player, entities, config.actionID);
        }
    }
}
